package cn.findviewbydream.evil.main.controller;

import cn.findviewbydream.evil.main.entity.OrderEntity;
import cn.findviewbydream.evil.main.service.IndexOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/********************************************
 * 工程名：MealOrder
 * 包名：cn.findviewbydream.evil.main.controller
 * 时间：16-12-21
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：当前活动的订单页面（默认为登录后的首页）
 ********************************************/
@Controller
public class IndexOrderController
{
    private final IndexOrderService indexOrderService;

    @Autowired
    public IndexOrderController(IndexOrderService indexOrderService) {this.indexOrderService = indexOrderService;}

    @RequestMapping("/index/order")
    public String index()
    {
        return "index_order";
    }

    @RequestMapping("/index/order/id/{id}")
    public String order(@PathVariable("id") int id)
    {
        return "order_details";
    }

    @RequestMapping("/index/order/get/order/list/unfinish")
    @ResponseBody
    public List<OrderEntity> getUnFinishOrderList()
    {
        return indexOrderService.getUnFinishOrderList();
    }


}
